package com.googlecode.mbhsrobopro.controller.gamepad;

public class StickLocation {
	
	public float x;
	public float y;
	
	public StickLocation(float y, float x) {
		this.x = x;
		this.y = y;
	}
	
	public float getDistance() {
		return (float) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
	}
	
	public boolean isAtOrigin() {
		boolean xCheck = Math.abs(x) < Math.pow(10, -4);
		boolean yCheck = Math.abs(y) < .22;
		
		return xCheck && yCheck;
	}
	
	public String toString() {
		return "(" + x + "," + y + ")";
	}

}
